﻿using System;
using System.IO;
using System.Web;
using System.Web.UI;


/// <summary>
///FormHtmlTextWriter 的摘要说明
/// </summary>
/// 
namespace QzEbook.ReWrite
{
    internal class FormHtmlTextWriter : HtmlTextWriter
    {
        private string rawurl;
        internal FormHtmlTextWriter(TextWriter writer):base(writer)
        {
            this.rawurl = HttpContext.Current.Request.RawUrl;
        }
       
        /// <summary>
        /// 再写Form的路径;
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="fEncode"></param>
        public override void WriteAttribute(string name, string value, bool fEncode)
        {
            if (rawurl != null && string.Compare(name, "action", true) == 0)
            {
                value = this.rawurl;
            }
            base.WriteAttribute(name, value, fEncode);
        }

    }
}